package com.hehe.controller;

import com.hehe.powernode.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "创建Feign客户端接口")
@RequestMapping("/feign")
@RestController
public class FeignConsumerController {
    @Autowired
    private FeignProviderClient feignProviderClient;

    /**
     * 测试Feign通信
     *
     * @return
     */
    @ApiOperation("测试Feign通信")
    @GetMapping("/consume")
    public Result<String> consume() {
        return feignProviderClient.getMessage();
    }
}
